<?php
/**
 * Created by PhpStorm.
 * User: dev
 * Date: 29/9/14
 * Time: 11:30 AM
 */

class Location {

    public function __construct() {
        parent::__construct();
    }


    public static function get() {
        $cookie = Cookie::get('location_cookie');
        if(!empty($cookie)){
            $loc = Locations::find($cookie);
            return $loc->name;
        }else{
            return Settings::get('en','default_location');
        }
    }

    public static function set($lid){
        if(!empty($lid)){
            if($lid){
                Cookie::forever('location_cookie', $lid);
            }
        }
    }



} 